<template>
  <div id="app">
    <router-view/>
  </div>
</template>
<script>
import Index_Pc from './components/index/Index_pc'
import Index_M from './components/index/Index_m'
export default {
  name: 'app',
   mounted() {
    if (this.isMobile()) {
      this.$router.push("Index_m");
    } else {
      this.$router.push("Index_pc");
    }
    
  },
   methods: {
    isMobile() {
      let flag = navigator.userAgent.match( // match方法可在字符串内检索指定的值，
        /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
      );
      // console.log(flag)
      return flag;

}
   }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  padding: 0;
  
}
</style>